home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir31
/
tnypla.zip
/
TEST.C
< prev
Wrap
C/C++ Source or Header
|
1994-04-06
|
812b
|
35 lines
/* test.c - program test */
#include <stdio.h>
#include <malloc.h>
#include "modplay.h"
int main()
{
FILE *handle;
void *modfile;
unsigned modsize;
if ((handle = fopen("test.mod","rb")) != NULL) {
fseek(handle,0L,SEEK_END);
modsize = ftell(handle);
fseek(handle,0L,SEEK_SET);
modfile = (void *) malloc(modsize);
fread(modfile,modsize,1,handle);
fclose(handle);
if (MODPlayModule(modfile,22000,0x220,7,1))
printf("Error initializing the MOD player.\n");
else {
printf("Playing... any key to stop.\n");
getch();
MODStopModule();
}
free(modfile);
}
else {
printf("Error loading modulefile.\n");
}
return 0;
}